<template>
  <dt-modal-edit ref='modal' title='选择引入模板' :label-width='90' :width='500' @ok='onOk' :loading='loading'>
  </dt-modal-edit>
</template>

<script>
  import Opt from './ImportOpt.js'
  
  export default {
    data() {
      return {
        type: 'template',
        info: {
          housesId: null,
          tmplId: null
        },
        loading: false
      }
    },
    mounted() {
    },
    methods: {
      show(type) {
        this.type = type
        this.$refs.modal.show(new Opt(this.info, type))
      },
      hide() {
        this.$refs.modal.hide()
      },
      onOk() {
        if (this.type == 'template') {
          this.$router.push({
            name: 'bonusTemplateEdit',
            query: {
              templateId: this.info.tmplId,
              flag: 'import'
            },
          })
        } else {
          this.$router.push({
            name: 'levelPointsEdit',
            query: {
              rankPointsId: this.info.tmplId,
              flag: 'import'
            }
          })
        }
      }
    }
  }
</script>

<style>
</style>
